/**
 * @Author YuanYuan
 * @Date 2022/6/5
 * @Time 20:37
 */

class Alg<T extends Comparable<T>> {

    public T findMaxVal(T[] array ) {

        T max = array[0];

        for (int i = 0; i < array.length; i++) {
            max = array[i].compareTo(max)>0?array[i]:max;
        }
        return max;

    }


}
public class TestDemo {
    public static void main(String[] args) {
        Alg<Integer> myarray = new Alg<>();
        Integer[] array = {78,99,130,0,-3,0};
        int max = myarray.findMaxVal(array);
        System.out.println(max);
    }
}
